﻿using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;

namespace ProjScan.ScanRuleFixer.Utils
{
	// Token: 0x020002B2 RID: 690
	public class PrefabUtils
	{
		// Token: 0x060011D9 RID: 4569 RVA: 0x00053E44 File Offset: 0x00052044
		public static string GetFullHierachyString(GameObject child)
		{
			GameObject gameObject = child.transform.root.gameObject;
			bool flag = object.Equals(child, gameObject);
			string result;
			if (flag)
			{
				result = string.Empty;
			}
			else
			{
				GameObject gameObject2 = child;
				Stack<string> stack = new Stack<string>();
				do
				{
					stack.Push(gameObject2.name);
					gameObject2 = gameObject2.transform.parent.gameObject;
				}
				while (!object.Equals(gameObject2, gameObject));
				StringBuilder stringBuilder = new StringBuilder();
				while (stack.Count > 1)
				{
					stringBuilder.Append(stack.Pop()).Append("/");
				}
				stringBuilder.Append(stack.Pop());
				result = stringBuilder.ToString();
			}
			return result;
		}
	}
}
